demo/toolpalette: Restore ToolItemGroup child prop
authorDaniel Boles <dboles@src.gnome.org>
Sat, 13 May 2017 17:04:19 +0000 (18:04 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Sat, 13 May 2017 17:39:13 +0000 (18:39 +0100)
…erties clobbered by commit c92b7d4224b9cef1d08373fcc28f7fbd96c64e6d.
That and its counterpart were for removing :expand and :fill child props
from GtkBox, but they ended up catching these for GtkToolItemGroup too.

While GtkToolItemGroup still has these, we may as well keep demoing them

demos/gtk-demo/toolpalette.c

index ad107f519f1801435a4fba6ae6e6d78405d97045..f69652816ae041cdb90a03a8dca0761148bdf1de 100644 (file)
@@ -124,11 +124,13 @@ palette_drop_item (GtkToolItem      *drag_item,
 
   if (GTK_TOOL_ITEM_GROUP (drag_group) != drop_group)
     {
-      gboolean homogeneous, new_row;
+      gboolean homogeneous, expand, fill, new_row;
 
       g_object_ref (drag_item);
       gtk_container_child_get (GTK_CONTAINER (drag_group), GTK_WIDGET (drag_item),
                                "homogeneous", &homogeneous,
+                               "expand", &expand,
+                               "fill", &fill,
                                "new-row", &new_row,
                                NULL);
       gtk_container_remove (GTK_CONTAINER (drag_group), GTK_WIDGET (drag_item));
@@ -136,6 +138,8 @@ palette_drop_item (GtkToolItem      *drag_item,
                                   drag_item, drop_position);
       gtk_container_child_set (GTK_CONTAINER (drop_group), GTK_WIDGET (drag_item),
                                "homogeneous", homogeneous,
+                               "expand", expand,
+                               "fill", fill,
                                "new-row", new_row,
                                NULL);
       g_object_unref (drag_item);
@@ -747,19 +751,19 @@ load_special_items (GtkToolPalette *palette)
   item = create_entry_item ("homogeneous=FALSE, expand=TRUE");
   gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
   gtk_container_child_set (GTK_CONTAINER (group), GTK_WIDGET (item),
-                           "homogeneous", FALSE,
+                           "homogeneous", FALSE, "expand", TRUE,
                            NULL);
 
   item = create_entry_item ("homogeneous=FALSE, expand=TRUE, fill=FALSE");
   gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
   gtk_container_child_set (GTK_CONTAINER (group), GTK_WIDGET (item),
-                           "homogeneous", FALSE,
-                           NULL);
+                           "homogeneous", FALSE, "expand", TRUE,
+                           "fill", FALSE, NULL);
 
   item = create_entry_item ("homogeneous=FALSE, expand=TRUE, new-row=TRUE");
   gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
   gtk_container_child_set (GTK_CONTAINER (group), GTK_WIDGET (item),
-                           "homogeneous", FALSE,
+                           "homogeneous", FALSE, "expand", TRUE,
                            "new-row", TRUE, NULL);
 
   item = gtk_tool_button_new (NULL, NULL);